package net.xuele.learn.testClass;

/**
 * Created by GaoQingming on 2019/4/17 0017.
 */
public class testClass3 {

    public static volatile String status = "run";

    public static void main(String[] args) {

        new Thread(() ->{
            try {
                Thread.sleep(4000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(Thread.currentThread().getName() + "：退出！");
            status = "exit";
            System.out.println(status);
        }).start();

        while ("run".equals(status)) {
            //System.out.println("当前是："+status);
            //System.out.println("123");
            if ("exit".equals(status)) {
                System.out.println(Thread.currentThread().getName() + "23333");
                break;
            }
        }
        System.out.println(Thread.currentThread().getName() + "：over!");
    }
}
